import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import ToolFormView from '../views/ToolFormView.vue' // Import the new view

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'dashboard', // Rename 'home' to 'dashboard' for clarity
      component: HomeView,
    },
    {
      path: '/tools/new',
      name: 'tool-create',
      component: ToolFormView,
    },
    {
      path: '/tools/:id/edit',
      name: 'tool-edit',
      component: ToolFormView,
    },
  ],
})

export default router
